home *** CD-ROM | disk | FTP | other *** search
/ develop, the CD; issue 1 / Apple_Develop_1989.bin / Offscreen / MPW 3.0 interfaces⁄text only
Text File  |  1989-12-15  |  10KB  |  433 lines

  1. MPW 3.0 interfaces for the OffScreen Support package of 32 Bit QD: 
  2.  
  3. {
  4. Created: Sunday, March 26, 1989 at 7:30 PM
  5.     Offscreen.p
  6.     Pascal Interface to the Macintosh Libraries
  7.  
  8.     Copyright Apple Computer, Inc.  1985-1989
  9.     All rights reserved
  10. }
  11.  
  12.  
  13. {$IFC UNDEFINED UsingIncludes}
  14. {$SETC UsingIncludes := 0}
  15. {$ENDC}
  16.  
  17. {$IFC NOT UsingIncludes}
  18.     UNIT Offscreen;
  19.     INTERFACE
  20. {$ENDC}
  21.  
  22. {$IFC UNDEFINED UsingOffscreen}
  23. {$SETC UsingOffscreen := 1}
  24.  
  25. {$I+}
  26. {$SETC OffscreenIncludes := UsingIncludes}
  27. {$SETC UsingIncludes := 1}
  28. {$IFC UNDEFINED UsingQuickdraw}
  29. {$I $$Shell(PInterfaces)Quickdraw.p}
  30. {$ENDC}
  31. {$SETC UsingIncludes := OffscreenIncludes}
  32.  
  33. CONST
  34.  
  35. { New error codes }
  36.  
  37. cDepthErr = -157;
  38.  
  39. { Set of flags used by Offscreen routines  }
  40.  
  41. Type GWorldFlags = SET OF (
  42.     pixPurge,
  43.     noNewDevice,
  44.     gWorldFlag2,
  45.     gWorldFlag3,
  46.     gWorldFlag4,
  47.     gWorldFlag5,
  48.     pixelsPurgeable,
  49.     pixelsLocked,
  50.     gWorldFlag8,
  51.     gWorldFlag9,
  52.     gWorldFlag10,
  53.     gWorldFlag11,
  54.     gWorldFlag12,
  55.     gWorldFlag13,
  56.     gWorldFlag14,
  57.     gWorldFlag15,
  58.     mapPix,
  59.     newDepth,
  60.     alignPix,
  61.     newRowBytes,
  62.     reallocPix,
  63.     gWorldFlag21,
  64.     gWorldFlag22,
  65.     gWorldFlag23,
  66.     gWorldFlag24,
  67.     gWorldFlag25,
  68.     gWorldFlag26,
  69.     gWorldFlag27,
  70.     clipPix,
  71.     stretchPix,
  72.     ditherPix,
  73.     gwFlagErr 
  74.     );
  75.  
  76. TYPE
  77.     GWorldPtr = CGrafPtr;
  78.  
  79.  
  80. FUNCTION NewGWorld (VAR offscreenGWorld: GWorldPtr; pixelDepth: INTEGER;
  81.             boundsRect: Rect; cTable: CTabHandle; aGDevice: GDHandle;
  82.             flags: GWorldFlags): QDErr;
  83.     INLINE $7000,$AB1D;
  84. FUNCTION LockPixels (pm: PixMapHandle): Boolean;
  85.     INLINE $7001,$AB1D;
  86. PROCEDURE UnlockPixels (pm: PixMapHandle);
  87.     INLINE $7002,$AB1D;
  88. FUNCTION UpdateGWorld (VAR offscreenGWorld: GWorldPtr; pixelDepth: INTEGER; 
  89.               boundsRect: Rect; cTable: CTabHandle; aGDevice: GDHandle;
  90.               flags: GWorldFlags): GWorldFlags;
  91.     INLINE $7003,$AB1D;
  92. PROCEDURE DisposeGWorld (offscreenGWorld: GWorldPtr);
  93.     INLINE $7004,$AB1D;
  94. PROCEDURE GetGWorld (VAR port: CGrafPtr; VAR gdh: GDHandle);
  95.     INLINE $7005,$AB1D;
  96. PROCEDURE SetGWorld (port: CGrafPtr; gdh: GDHandle);
  97.     INLINE $7006,$AB1D;
  98. PROCEDURE CTabChanged (ctab: CTabHandle);
  99.     INLINE $7007,$AB1D;
  100. PROCEDURE PixPatChanged (ppat: PixPatHandle);
  101.     INLINE $7008,$AB1D;
  102. PROCEDURE PortChanged (port: GrafPtr);
  103.     INLINE $7009,$AB1D;
  104. PROCEDURE GDeviceChanged (gdh: GDHandle);
  105.     INLINE $700A,$AB1D;
  106. PROCEDURE AllowPurgePixels (pm: PixMapHandle);
  107.     INLINE $700B,$AB1D;
  108. PROCEDURE NoPurgePixels (pm: PixMapHandle);
  109.     INLINE $700C,$AB1D;
  110. FUNCTION GetPixelsState (pm: PixMapHandle): GWorldFlags;
  111.     INLINE $700D,$AB1D;
  112. PROCEDURE SetPixelsState (pm: PixMapHandle; state: GWorldFlags);
  113.     INLINE $700E,$AB1D;
  114. FUNCTION GetPixBaseAddr (pm: PixMapHandle): Ptr;
  115.     INLINE $700F,$AB1D;
  116. FUNCTION NewScreenBuffer (globalRect: Rect; purgeable: BOOLEAN;
  117.                VAR gdh: GDHandle; VAR offscreenPixMap: PixMapHandle): QDErr;
  118.     INLINE $7010,$AB1D;
  119. PROCEDURE DisposeScreenBuffer (offscreenPixMap: PixMapHandle);
  120.     INLINE $7011,$AB1D;
  121. FUNCTION GetGWorldDevice (offscreenGWorld: GWorldPtr): GDHandle;
  122.     INLINE $7012,$AB1D;
  123.  
  124.  
  125. {$ENDC}    { UsingOffscreen }
  126.  
  127. {$IFC NOT UsingIncludes}
  128.     END.
  129. {$ENDC}
  130.  
  131. /************************************************************
  132.  
  133. Created: Thursday, March 23, 1989 at 7:25 PM 
  134.     Offscreen.h
  135.     C Interface to the Macintosh Libraries
  136.  
  137.  
  138.     Copyright Apple Computer, Inc.  1985-1989
  139.     All rights reserved
  140.  
  141. ************************************************************/
  142.  
  143.  
  144. #ifndef __OFFSCREEN__
  145. #define __OFFSCREEN__
  146.  
  147. #ifndef __QUICKDRAW__
  148. #include <Quickdraw.h>
  149. #endif
  150.  
  151. /* New error codes */
  152.  
  153. #define cDepthErr -157            /* invalid pixel depth */
  154.  
  155.  
  156. /* Flag bits passed to or returned by Offscreen routines */
  157.  
  158. enum  {
  159.     pixPurgeBit = 0,
  160.     noNewDeviceBit = 1,
  161.     pixelsPurgeableBit = 6,
  162.     pixelsLockedBit = 7,
  163.  
  164.     mapPixBit = 16,            /* set if color table mapping occurred */
  165.     newDepthBit = 17,            /* set if pixels were scaled to a different depth */
  166.     alignPixBit = 18,            /* set if pixels were realigned to screen alignment */
  167.      newRowBytesBit = 19,        /* set if pixmap was reconfigured in a new rowBytes */
  168.     reallocPixBit = 20,        /* set if offscreen buffer had to be reallocated */
  169.     clipPixBit = 28,            /* set if pixels were or are to be clipped */
  170.     stretchPixBit = 29,        /* set if pixels were or are to be stretched/shrinked */
  171.     ditherPixBit = 30,
  172.     gwFlagErrBit = 31
  173. };
  174.  
  175. typedef enum {
  176.     pixPurge = 1 << pixPurgeBit,
  177.     noNewDevice = 1 << noNewDeviceBit,
  178.     pixelsPurgeable = 1 << pixelsPurgeableBit,
  179.     pixelsLocked = 1 << pixelsLockedBit,
  180.     mapPix = 1 << mapPixBit,
  181.     newDepth = 1 << newDepthBit,
  182.     alignPix = 1 << alignPixBit,
  183.     newRowBytes = 1 << newRowBytesBit,
  184.     reallocPix = 1 << reallocPixBit,
  185.     clipPix = 1 << clipPixBit,
  186.     stretchPix = 1 << stretchPixBit,
  187.     ditherPix = 1 << ditherPixBit,
  188.     gwFlagErr = 1 << gwFlagErrBit
  189. }GWorldFlag;
  190.  
  191. typedef long GWorldFlags;
  192.  
  193. /* Type definition of a GWorldPtr */
  194.  
  195. typedef CGrafPtr GWorldPtr;
  196.  
  197.  
  198. #ifdef __safe_link
  199. extern "C" {
  200. #endif
  201. pascal QDErr NewGWorld (GWorldPtr *offscreenGWorld, short pixelDepth,
  202.         Rect *boundsRect, CTabHandle cTable, GDHandle aGDevice, GWorldFlags flags)
  203.     = {0x7000,0xAB1D};
  204. pascal Boolean LockPixels (PixMapHandle pm)
  205.     = {0x7001,0xAB1D};
  206. pascal void UnlockPixels (PixMapHandle pm)
  207.     = {0x7002,0xAB1D};
  208. pascal GWorldFlags UpdateGWorld (GWorldPtr *offscreenGWorld, short pixelDepth,
  209.         Rect *boundsRect, CTabHandle cTable, GDHandle aGDevice, GWorldFlags flags)
  210.     = {0x7003,0xAB1D};
  211. pascal void DisposeGWorld (GWorldPtr offscreenGWorld)
  212.     = {0x7004,0xAB1D};
  213. pascal void GetGWorld (CGrafPtr *port, GDHandle *gdh)
  214.     = {0x7005,0xAB1D};
  215. pascal void SetGWorld (CGrafPtr port, GDHandle gdh)
  216.     = {0x7006,0xAB1D};
  217. pascal void CTabChanged (CTabHandle ctab)
  218.     = {0x7007,0xAB1D};
  219. pascal void PixPatChanged (PixPatHandle ppat)
  220.     = {0x7008,0xAB1D};
  221. pascal void PortChanged (GrafPtr port)
  222.     = {0x7009,0xAB1D};
  223. pascal void GDeviceChanged (GDHandle gdh)
  224.     = {0x700A,0xAB1D};
  225. pascal void AllowPurgePixels (PixMapHandle pm)
  226.     = {0x700B,0xAB1D};
  227. pascal void NoPurgePixels (PixMapHandle pm)
  228.     = {0x700C,0xAB1D};
  229. pascal GWorldFlags GetPixelsState (PixMapHandle pm)
  230.     = {0x700D,0xAB1D};
  231. pascal void SetPixelsState (PixMapHandle pm, GWorldFlags state)
  232.     = {0x700E,0xAB1D};
  233. pascal Ptr GetPixBaseAddr (PixMapHandle pm)
  234.     = {0x700F,0xAB1D};
  235. pascal QDErr NewScreenBuffer (Rect *globalRect, Boolean purgeable, GDHandle *gdh,
  236.         PixMapHandle *offscreenPixMap)
  237.     = {0x7010,0xAB1D};
  238. pascal void DisposeScreenBuffer (PixMapHandle offscreenPixMap)
  239.     = {0x7011,0xAB1D};
  240. pascal GDHandle GetGWorldDevice (GWorldPtr offscreenGWorld)
  241.     = {0x7012,0xAB1D};
  242. #ifdef __safe_link
  243. }
  244. #endif
  245. #endif
  246.  
  247. ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  248. ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  249. ; Created: Friday, March 24 at 10:57 AM
  250. ;
  251. ; File: OffscreenTraps.a
  252. ;
  253. ; Assembler Interface to the Macintosh Libraries
  254. ; Copyright Apple Computer, Inc. 1984-1989
  255. ; All Rights Reserved
  256. ;
  257. ;___________________________________________________________________________
  258. ;
  259. ; Offscreen Equates -- This file defines the equates for Offscreen
  260. ; routines.
  261. ;___________________________________________________________________________
  262.  
  263.  
  264.  
  265. ; New Error codes
  266.  
  267. cDepthErr    equ    -157    ; invalid pixel depth 
  268.  
  269.  
  270. ; Flag bits passed to or returned by UpdateGWorld
  271.  
  272. purgePixBit    equ    0    ; make the offscreen buffer purgeable
  273. noNewDeviceBit    equ    1    ; don't create an offscreen device
  274. pixelsPurgeableBit equ    6    ; pixels are pureable
  275. pixelsLockedBit    equ    7    ; pixels are locked
  276. mapPixBit    equ    16    ; set if color table mapping occurred
  277. newDepthBit    equ    17    ; set if pixels were scaled to a different depth
  278. alignPixBit    equ    18    ; set if pixels were realigned to screen alignment
  279. newRowBytesBit    equ    19    ; set if pixmap was reconfigured in a new rowBytes
  280. reallocPixBit    equ    20    ; set if offscreen buffer had to be reallocated
  281. clipPixBit    equ    28    ; set if pixels were or are to be clipped
  282. stretchPixBit    equ    29    ; set if pixels were or are to be stretched/shrinked
  283. ditherPixBit    equ    30    ; set if pixels were or are to be dithered
  284. gwFlagErrBit    equ     31    ; sign bit set indicates error
  285.  
  286. ; Mask equivalents of the above bits 
  287.  
  288. purgePix    equ    $1
  289. noNewDevice    equ    $2
  290. pixelsPurgeable     equ    $40
  291. p